
<!-- start: PAGE -->
<div class="main-content">			
    <div class="container">
        <!-- start: PAGE HEADER -->
        <div class="row">
            <div class="col-sm-12">
                <!-- start: STYLE SELECTOR BOX -->

                <!-- end: STYLE SELECTOR BOX -->
                <!-- start: PAGE TITLE & BREADCRUMB -->
                <ol class="breadcrumb">
                    <li>
                        <i class="clip-file"></i>
                        <a href="#">
                            Panel Administrativo
                        </a>
                    </li>
                    <li class="active">
                        Administrar
                    </li>	
                </ol>
                <div class="page-header">
                    <h1>Panel Administrativo <small>Administrar</small></h1>
                </div>
                <!-- end: PAGE TITLE & BREADCRUMB -->
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="icon-external-link-sign"></i>
                        Productos
                        <div class="panel-tools">
                            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
                            </a>
                            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                                <i class="icon-wrench"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-refresh" href="#">
                                <i class="icon-refresh"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-expand" href="#">
                                <i class="icon-resize-full"></i>
                            </a>
                            <!--<a class="btn btn-xs btn-link panel-close" href="#">
                                <i class="icon-remove"></i>
                            </a> -->
                        </div>
                    </div>
                    <div class="panel-body">
                        <form method="post">
                            <div class="form-horizontal">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">Usuarios</label>
                                            <div class="col-sm-7">
                                                <?php
                                                $css = 'class="form-control search-select" id="users" placeholder="Seleccione Usuario"';
                                                echo form_dropdown("users", $users, null, $css);
                                                ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <hr/>
                            <p>Páginas</p>                            
                            <div class="alert" id="mensaje" style="display: none;"></div>
                            <div id="permisos"></div>
                            <div class="row">
                                <div class="col-md-3"></div>
                                <div class="col-md-2">
                                    <button class="btn btn-primary btn-block" type="button" id="guardarPermisos">
                                        <i class="icon-save"></i>
                                        Guardar                                        
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- end: PAGE -->

<script>
    $(function() {
        $("#users").on('change', function() {
            paginas_permisos('<?= base_url("acceso/panel"); ?>/' + $("#users").val());
        });

        $("#guardarPermisos").on("click", function() {
            actualizarPermisos("<?= base_url('acceso/permisos'); ?>");
        });
    });
</script>

